local mt = ac.buff['晕眩']

mt.control = 10
mt.debuff = true
mt.effect_only_one = 1
mt.ref = 'overhead'
mt.model = [[Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl]]

mt.art = 'ReplaceableTextures\\CommandButtons\\BTNStun.blp'
mt.title = '眩晕'
mt.tip = '该单位被眩晕了，所以不能移动，攻击和施放魔法。'

function mt:on_add()
	local unit = self.owner
	unit:add_restriction '晕眩'
	--unit:cast_stop()

	if self.model then
		self.effect = unit:add_effect(self.model,self.ref)
	end
end

function mt:on_remove()
	local unit = self.owner
	unit:remove_restriction '晕眩'
	if self.effect then
		self.effect:remove()
	end
end

function mt:on_cover(new)
	if new.time > self:get_remaining() then
		self:set_remaining(new.time)
	end
	return false
end
